﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PhilipService.Entity;

namespace TRTCMain
{
    public partial class DeviceDetail : UserControl
    {
        public DeviceDetail()
        {
            InitializeComponent();           
        }

        public void SetDeviceInfo(GetDeviceInfoResponse res) {
            if (res != null)
            {
                label_devicename.Text = res.DeviceName;
                label_model.Text = res.Model;
                label_company.Text = res.Company;
                label_department.Text = res.Department;
                label_SNCode.Text = res.SNCode;
            }
        }

        private void DeviceDetail_Paint(object sender, PaintEventArgs e)
        {
            
        }

        private void DeviceDetail_SizeChanged(object sender, EventArgs e)
        {
            this.Refresh();
        }

        private void DeviceDetail_Load(object sender, EventArgs e)
        {

        }

        private void panel_Paint(object sender, PaintEventArgs e)
        {
            //var pen = new Pen(Color.LightGray);
            //e.Graphics.DrawLine(pen, new Point(0, 0), new Point(this.Width, 0));
            //e.Graphics.DrawLine(pen, new Point(panel.Width - 1, 0), new Point(panel.Width - 1, panel.Height - 1));
            //e.Graphics.DrawLine(pen, new Point(0, panel.Height - 1), new Point(panel.Width - 1, panel.Height - 1));
            //e.Graphics.DrawLine(pen, new Point(0, panel.Height - 1), new Point(0, 0));
        }

        private void btn_copy_Click(object sender, EventArgs e)
        {
            Clipboard.SetDataObject(label_SNCode.Text);
        }
    }
}
